package com.wnn.demo.model.system.mapper;

import com.wnn.demo.domain.Permission;
import com.wnn.demo.utils.IBaseMapper;
import com.wnn.demo.vo.MenuTreeVo;
import org.apache.ibatis.annotations.Param;

import java.util.*;

/**
* Created by Mybatis Generator on 2019/08/31
*/

public interface PermissionMapper extends IBaseMapper<Permission> {

    int permBatchDelete(@Param("ids") String ids);

    /**得到菜单或者权限
     * @param type 1菜单 2权限
     * @return
     */
    List< Permission> getMenuOrPermList(@Param("type") Integer type);


    List< Permission> findAll(@Param("type") String type);

    /**
     * 得到的菜单权限
     * @return  MenuTreeVo 树结构的包装类
     */
    List< MenuTreeVo > selectAllPermTreeVo();


    /**
     * 根据用户名称查询用户拥有的权限
     * @param type
     * @param username
     * @return
     */
    List< MenuTreeVo> selectPermMenuTreeVoListByUserNameAndType(@Param("username") String username, @Param("type") Integer type, @Param("isEnable") Integer isEnable);
}